#!/usr/bin/env python3
import math

print(r"\\\\r")  # \\\\r
# 对于单个字符的编码，Python提供了ord()函数获取字符的整数表示，chr()函数把编码转换为对应的字符：
print(ord("中"), ord("A"), chr(66), chr(25991))
print("\u4e2d\u6587")

print("hello world, %s and %d" % ("huhx", 45))
lover = ["huhx", "liuling", "java"]
lover.insert(1, "python")
print(len(lover), lover.pop(0))  # 4 huhx

lover = ("node.js", "html", "javascript", "html")
print(len(lover))  # 4
print(lover.count("html"))  # 2

print("中国你")

def person(name, age):
    return name, math.cos(age)

def pows(x, n=2):
    s = 1
    while n > 0:
        n = n - 1
        s = s * x
    return s

def calc(number):
    sum = 0
    for n in number:
        sum = sum + n
    return sum

def calc2(*number):
    return calc(number)

if __name__ == '__main__':
    pers = person("hello", 90)
    print(pers)
    print(pows(5, 3))
    print(pows(5))

    # func calc(number)
    print(calc([1, 2, 3])) # 6
    print(calc((1, 3, 4))) # 8

    # func calc2(*number)
    print(calc2(1, 2, 3)) # 6